<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../boot/res/layui/css/layui.css">
<%--    <link rel="stylesheet" href="../../../boot/res/css/global.css">--%>

    <script src="../../../boot/res/layui/layui.js"></script>
    <script src="../../../boot/res/js/jquery.min.js"></script>
    <script src="../../../boot/res/js/im.js"></script>
<%--    <script src="../../../boot/res/js/chat.js"></script>--%>
</head>
<body>

<script>
    layui.use('layim', function(layim) {


        // // 先来个客服模式压压精
        // layim.config({
        //     brief: true //是否简约模式（如果true则不显示主面板）
        // }).chat({
        //     name: '客服姐姐'
        //     , type: 'friend'
        //     , avatar: 'http://tp1.sinaimg.cn/5619439268/180/40030060651/1'
        //     , id: -2
        // });


        var $ = layui.jquery;


        layim.config({
            brief: true //是否简约模式（如果true则不显示主面板）
            ,voice: false
            ,chatLog: layui.cache.dir + 'css/modules/layim/html/chatlog.html'
        });



        var tiows = new tio.ws($,layim);

        //获取个人信息 并且打开聊天窗口
        tiows.openChatWindow();

        // 历史聊天信息回显
        tiows.initHistoryMess();

        //建立连接ws
        tiows.connect();

        // 发送消息
        layim.on('sendMessage', function (res) {
            tiows.sendChatMessage(res);
        });

    });
</script>
</body>
</html>